<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
	<meta charset="UTF-8">
	<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />
	<link rel="stylesheet" type="text/css" href="js/select2/select2.css" />
	<title>凯盛项目管理系统</title>
	<style type="text/css">
		body{
			background-image:url(img/bg8.jpg);
		}
		
	</style>
</head>
<body class="body" style="padding-top:50px">
	<%@include file="include/top.jsp"  %>
		<div class="container">
			<div class="row">
				<div class="span10">
					<form class="form-horizontal" action="logic.jspx?m=update" method="post" id="myform">
						<fieldset>
							<legend>项目设置</legend>
							<input type="hidden" name="proId" value="${userpro.project.proId }">
							<div class="control-group">
								<label for="" class="control-label">项目名称</label>
								<div class="controls">
									<input type="text" name="proName" value="${userpro.project.proName }" class="span4"/>
								</div>
							</div>
							
							<div class="control-group">
								<label for="" class="control-label">项目描述</label>
								<div class="controls">
									<textarea name="describe" id="" rows="6"  class="span5">${userpro.project.describe }</textarea>
								</div>
							</div>
							
							<div class="control-group">
								<label for="" class="control-label">负责人</label>
								<div class="controls">
									<select name="manager" id="" class="multiSelect" style="width:200px">
										<c:forEach items="${userlist}" var="u">
											<option value="${u.id }">${u.username }</option>
										</c:forEach>
									</select>
								</div>
							</div>
							
							<div class="control-group">
								<label for="" class="control-label">项目成员</label>
								<div class="controls">
									<select name="worker" id="worker" multiple class="multiSelect" style="width:400px">
										<c:forEach items="${userlist}" var="u">
											<option value="${u.id }">${u.username }</option>
										</c:forEach>											
									</select>
								</div>
							</div>
							<input type="hidden" name="workers" id="workers">
							<div class="form-actions" style=background-color:#FFF;>
								<button id="btnsave" class="btn btn-primary">保存</button>
								<button class="btn btn-danger">返回</button>
							</div>
							
						</fieldset>
						
					</form>
				</div>
			</div>
		</div>
		<script type="text/javascript" src="js/jquery.js"></script>
		<script type="text/javascript" src="js/select2/select2.min.js"></script>
		<script type="text/javascript">
			$(document).ready(function(){
				$(".multiSelect").select2();
				$("#btnsave").click(function(){
					var v = $("#worker").select2("val");
					$("#workers").val(v);
					$("#myform").submit();
				});
			});
	</script>
	
</body>
</html>